package net.vsame.url2sql;

import java.util.List;
import java.util.Map;

import net.vsame.url2sql.dao.JdbcUtils;

import com.alibaba.fastjson.JSON;

public class Config {

	public static void main(String[] args) {
		//testList();
		List<String> tables = JdbcUtils.getAllTables();
		System.out.println(tables);
	}
	
	public static void testList(){
		List<Map<String, Object>> list = JdbcUtils.queryList("select * from sms where id in(?)", "1,2,3,4,5,6,123");
		String json = JSON.toJSONString(list);
		System.out.println("-------------");
		System.out.println(json);
		System.out.println("-------------");
	}
	
	public static void testCount(){
		long count = JdbcUtils.queryCount("select count(*) from plain");
		System.out.println("-------------");
		System.out.println(count);
		System.out.println("-------------");
	}
	
	public static void save(){
		int count = JdbcUtils.execute("INSERT INTO `sms`(id, createTime, content, smsType) VALUES (?, ?, ?, ?)", "123", "2012-02-22", "Hello, Nobody!", "Gaollg");
		System.out.println(count);
	}

}
